﻿<%@ Page Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="Customer.aspx.cs"
    Inherits="Web.PuntoDeVenta.App.Customer" %>

<%@ Import Namespace="Web.Framework.Translate" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
    <link href="/Styles/GridStyle.css" rel="stylesheet" type="text/css" />
    <link href="/Styles/jquery-ui-1.8.15.custom.css" rel="stylesheet" type="text/css" />
    <link href="/Styles/CustomerStyle.css" rel="stylesheet" type="text/css" />
    <link href="/Styles/jquery.datepick.css" rel="stylesheet" type="text/css" />
    <link href="/Styles/ui.dropdownchecklist.standalone.css" rel="stylesheet" type="text/css" />
    <script src="/Scripts/jquery-1.6.1.min.js" type="text/javascript"></script>
    <script src="/Scripts/jquery-ui-1.8.13.custom.min.js" type="text/javascript"></script>
    <script src="/Scripts/ui.dropdownchecklist.js" type="text/javascript"></script>
    <script src="/Scripts/jquery.datepick.js" type="text/javascript"></script>
    <script src="/Scripts/jquery.datepick-es-AR.js" type="text/javascript"></script>
    <script src="/Scripts/CustomerSearch.js?reload=6" type="text/javascript"></script>
    <script src="/Scripts/json2.min.js" type="text/javascript"></script>
    <script src="/Scripts/jqueryWCF.js?v=2" type="text/javascript"></script>
    <script src="/Scripts/inputshints.js" type="text/javascript"></script>
    <script src="/Scripts/DirtyCheck.js" type="text/javascript"></script>
    <%--<script type="text/javascript">
        $(function () {
            $('#txtFechaCumple').datepick({ dateFormat: 'dd/mm/yyyy' });
        });
    </script>--%>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="TitleContent" runat="server">
    <div class="pnlIrAInicio">
        <asp:LinkButton ID="lnkIrAInicio" runat="server" CssClass="lnkIrAInicio" OnClick="lnkIrAInicio_Click">
            <img src="/Images/home.png" alt="" width="25px" height="25px" /><span><asp:Literal
                ID="Literal1" runat="server" Text='<%$ Code:  LocalizationProvider.Instance["LinkIrAlInicio"]%>' /></span></asp:LinkButton>
    </div>
    <asp:Panel ID="pnlTotales" runat="server" ClientIDMode="Static" CssClass="pnlTotalVentas">
        <asp:Label ID="lblCantidadTotales" runat="server" Text=""></asp:Label>
    </asp:Panel>
    <div class="clear">
    </div>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <%--Panel de decisión de modo de carga de datos--%>
    <asp:Panel ID="pnlHome" runat="server" ClientIDMode="Static" CssClass="pnlHome">
        <div class="pnlHomeOuter">
            <div class="editionContainerFilter pnlModo">
                <asp:Button ID="btnModoVenta" CssClass="btnModoVenta" ClientIDMode="Static" runat="server"
                    Text='<%$ Code:  LocalizationProvider.Instance["ButtonCargarVenta"] %>' OnClick="btnModoVenta_Click"
                    ToolTip='<%$ Code:  LocalizationProvider.Instance["TooltipCargarVenta"] %>' />
                <asp:Button ID="btnModoActualizar" CssClass="btnModoActualizar" ClientIDMode="Static"
                    runat="server" Text='<%$ Code:  LocalizationProvider.Instance["ButtonActualizarDatos"] %>'
                    OnClick="btnModoActualizar_Click" ToolTip='<%$ Code:  LocalizationProvider.Instance["TooltipActualizarDatos"] %>' />
                <div class="clear">
                </div>
                <asp:CheckBox ID="chkRecordarMiDecision" runat="server" Text='<%$ Code:  LocalizationProvider.Instance["CheckRecordarDecisionCargaOActualizacion"] %>'
                    CssClass="chkRecordarMiDecision" ClientIDMode="Static" />
            </div>
        </div>
    </asp:Panel>
    <%--Panel de busqueda--%>
    <asp:Panel ID="pnlSearch" runat="server" Visible="false" ClientIDMode="Static">
        <h2>
            <asp:Label ID="lblTitulo" runat="server" Text='<%$ Code:  LocalizationProvider.Instance["Bo.SearchContacto.BusquedaTitulo"]%>'></asp:Label>
        </h2>
        <div class="editionContainerFilter">
            <div class="divp pbuscar pbuscarFactura" runat="server" id="parrafoSearch" clientidmode="Static">
                <span class="title">
                    <asp:Literal ID="Literal2" runat="server" Text='<%$ Code:  LocalizationProvider.Instance["FacturaText"]%>' /></span>
                <asp:TextBox ID="txtSearchFactura" runat="server" CssClass="inputs" ClientIDMode="Static"
                    title='<%$ Code:  LocalizationProvider.Instance["FacturaTextTitle"] %>' MaxLength="6"></asp:TextBox>
                <span id="validationSearchFactura" runat="server" clientidmode="Static" style="color: red">
                    *</span>
            </div>
            <div class="divp pbuscar">
                <span class="title2">
                    <asp:Literal ID="Literal3" runat="server" Text='<%$ Code:  LocalizationProvider.Instance["NombreDniEmailText"]%>' /></span>
                <asp:TextBox ID="txtDniEmail" runat="server" CssClass="inputs inputlong" ClientIDMode="Static"
                    title='<%$ Code:  LocalizationProvider.Instance["NombreDniEmailTextTitle"] %>'></asp:TextBox>
                <span id="validationSearchEmail" runat="server" clientidmode="Static" style="color: red">
                    *</span>
            </div>
            <asp:Button ID="btnBuscar" runat="server" Text='<%$ Code:  LocalizationProvider.Instance["ButtonBuscar"]%>'
                CssClass="btnBuscar" ClientIDMode="Static" OnClick="btnBuscar_Click" OnClientClick="return window.CustomerSearchObj.ValidateSearch();" />
            <div class="clear">
            </div>
        </div>
    </asp:Panel>
    <%--Panel de seleccion de cliente cuando hay multiples--%>
    <asp:Panel ID="pnlSearchResults" runat="server" Visible="false" ClientIDMode="Static">
        <h2>
            <asp:Literal ID="Literal4" runat="server" Text='<%$ Code:  LocalizationProvider.Instance["SeleccionarPosibleClienteText1"]%>' />
            <asp:LinkButton ID="lnkAgregarNuevoDesdeGrilla" OnClick="btnAgregarNuevoContacto_Click"
                CssClass="nuevoClienteLnk" runat="server">
                <asp:Literal ID="Literal5" runat="server" Text='<%$ Code:  LocalizationProvider.Instance["SeleccionarPosibleClienteText2"]%>' /></asp:LinkButton>
        </h2>
        <span class="classSearchResult">
            <asp:Literal ID="Literal29" runat="server" Text='<%$ Code: LocalizationProvider.Instance["Bo.SearchContacto.ListadoDeClientes"]%>' />
            <asp:Label ID="lblSearchResult" runat="server" Text="" CssClass="lblSearchResult"></asp:Label>
        </span>
        <asp:ObjectDataSource ID="CustomerObjectDs" runat="server" TypeName="Web.Framework.Search.GridViewSearchObjectDataSource"
            SortParameterName="sortExpression" SelectMethod="GetObjects" SelectCountMethod="TotalNumberOfGetObjects"
            EnablePaging="True" OnObjectCreating="CustomerObjectDs_ObjectCreating" OnSelected="GridCustomer_Selected">
        </asp:ObjectDataSource>
        <asp:GridView ID="GridClientes" runat="server" CellPadding="4" ForeColor="#333333"
            PageSize="100" DataSourceID="" GridLines="None" AutoGenerateColumns="False" DataKeyNames="Id"
            Width="100%" AllowPaging="True" AllowSorting="False" OnPageIndexChanging="GridClientes_PageIndexChanging"
            OnRowCommand="GridClientes_RowCommand" OnRowDataBound="GridClientes_RowDataBound"
            OnDataBound="GridClientes_DataBound">
            <AlternatingRowStyle BackColor="White" />
            <Columns>
                <asp:ButtonField ButtonType="Image" CommandName="editar" ImageUrl="~/Images/editar.png"
                    Text="Button" AccessibleHeaderText="editar">
                    <HeaderStyle HorizontalAlign="Left" Width="30px" />
                    <ItemStyle HorizontalAlign="Center" />
                </asp:ButtonField>
                <asp:BoundField DataField="Id" HeaderText="Id" Visible="false">
                    <HeaderStyle HorizontalAlign="Left" />
                </asp:BoundField>
                <asp:BoundField DataField="Nombre" HeaderText='<%$ Code:  LocalizationProvider.Instance["ContactoNombre"]%>'>
                    <HeaderStyle HorizontalAlign="Left" />
                </asp:BoundField>
                <asp:BoundField DataField="Apellido" HeaderText='<%$ Code:  LocalizationProvider.Instance["ContactoApellido"]%>'>
                    <HeaderStyle HorizontalAlign="Left" />
                </asp:BoundField>
                <asp:BoundField DataField="Email" HeaderText='<%$ Code:  LocalizationProvider.Instance["ContactoEmail"]%>'>
                    <HeaderStyle HorizontalAlign="Left" />
                </asp:BoundField>
                <asp:BoundField DataField="Dni" HeaderText='<%$ Code:  LocalizationProvider.Instance["ContactoDocumento"]%>'>
                    <HeaderStyle HorizontalAlign="Left" />
                </asp:BoundField>
                <asp:BoundField DataField="FechaUltimaCompra" HeaderText='<%$ Code:  LocalizationProvider.Instance["ContactoUltimaCompra"]%>'
                    DataFormatString="{0:dd/MM/yyyy}">
                    <HeaderStyle HorizontalAlign="Left" Wrap="false" />
                </asp:BoundField>
            </Columns>
            <EditRowStyle BackColor="#2461BF" />
            <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
            <HeaderStyle BackColor="#4b6c9e" Font-Bold="True" ForeColor="White" HorizontalAlign="Left" />
            <PagerStyle BackColor="#4b6c9e" ForeColor="White" HorizontalAlign="Center" />
            <RowStyle BackColor="#EFF3FB" />
            <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
            <SortedAscendingCellStyle BackColor="#F5F7FB" />
            <SortedAscendingHeaderStyle BackColor="#6D95E1" />
            <SortedDescendingCellStyle BackColor="#E9EBEF" />
            <SortedDescendingHeaderStyle BackColor="#4870BE" />
        </asp:GridView>
    </asp:Panel>
    <%--Panel de informacion del cliente--%>
    <asp:Panel ID="pnlCustomerEdit" runat="server" Visible="false" ClientIDMode="Static">
        <div class="clienteEditTitle">
            <h2>
                <asp:Label ID="lblClienteEdit" runat="server" Text=""></asp:Label>
                <br />
                <asp:Label ID="lblClienteEditLine2" runat="server" Text="" CssClass="lblClienteEditLine2"></asp:Label>
                <asp:LinkButton ID="lnkAgregarClienteNuevoDesdeEdit" OnClick="btnAgregarNuevoContacto_Click"
                    CssClass="nuevoClienteLnkLine2" runat="server">
                    <asp:Literal ID="Literal6" runat="server" Text='<%$ Code:  LocalizationProvider.Instance["SeleccionarPosibleClienteText2"]%>' /></asp:LinkButton>
            </h2>
            <div class="cmdCustomerBar">
                <asp:LinkButton ID="btnBitacora" runat="server" ClientIDMode="Static" Text='<%$ Code:  LocalizationProvider.Instance["Pdv.CustomerViewBitacora.Link"]%>'></asp:LinkButton>
                <asp:LinkButton ID="btnVentas" runat="server" ClientIDMode="Static" Text='<%$ Code:  LocalizationProvider.Instance["Pdv.CustomerViewSales.Link"]%>'></asp:LinkButton>
            </div>
            <div class="clear"></div>
        </div>
        <asp:Panel ID="pnlDatosClientes" runat="server" ClientIDMode="Static" CssClass="editionContainerFilter">
            <asp:HiddenField ID="hidClienteId" runat="server" ClientIDMode="Static" />
            <div class="divDatosLeft">
                <div class="divp">
                    <span class="title2">
                        <asp:Literal ID="Literal7" runat="server" Text='<%$ Code:  LocalizationProvider.Instance["ContactoTipoDocText"]%>' />:</span>
                    <asp:DropDownList ID="cboTipoDocumento" runat="server" CssClass="cboDia">
                    </asp:DropDownList>
                </div>
                <div class="clear">
                </div>
                <div class="divp">
                    <span class="title2 compulsory">
                        <asp:Literal ID="Literal8" runat="server" Text='<%$ Code:  LocalizationProvider.Instance["ContactoDocumentoShort"]%>' />:</span>
                    <asp:TextBox ID="txtDNI" runat="server" CssClass="inputs" ClientIDMode="Static" title='<%$ Code:  LocalizationProvider.Instance["ContactoDocumentoTitle"]%>'></asp:TextBox>
                </div>
                <div class="clear">
                </div>
                <div class="divp">
                    <span class="title2 compulsory">
                        <asp:Literal ID="Literal9" runat="server" Text='<%$ Code:  LocalizationProvider.Instance["ContactoEmail"]%>' />:</span>
                    <asp:TextBox ID="txtEmail" runat="server" CssClass="inputs inputlong" ClientIDMode="Static"
                        title='<%$ Code:  LocalizationProvider.Instance["ContactoEmailTitle"]%>'></asp:TextBox>
                    <span runat="server" id="spanEmailInvalido" class="errorAsterisk displayNone" title='<%$ Code:  LocalizationProvider.Instance["ContactoEmailTextInvalid"]%>'>
                        *</span>
                    <asp:HiddenField ID="hidEmail" runat="server" ClientIDMode="Static" />
                </div>
                <div class="clear">
                </div>
                <div class="divp">
                    <span class="title2">
                        <asp:Literal ID="Literal10" runat="server" Text='<%$ Code:  LocalizationProvider.Instance["ValidationRepitaEmail"]%>' />:</span>
                    <asp:TextBox ID="txtEmailVerify" runat="server" CssClass="inputs inputlong" ClientIDMode="Static"
                        title='<%$ Code:  LocalizationProvider.Instance["ValidationReescribirEmailTitle"]%>'></asp:TextBox>
                </div>
                <div class="clear">
                </div>
                <div class="divp">
                    <span class="title2">
                        <asp:Literal ID="Literal11" runat="server" Text='<%$ Code:  LocalizationProvider.Instance["ContactoNombre"]%>' />:</span>
                    <asp:TextBox ID="txtNombre" runat="server" CssClass="inputs inputlong" ClientIDMode="Static"
                        title='<%$ Code:  LocalizationProvider.Instance["ContactoNombreTitle"]%>'></asp:TextBox>
                </div>
                <div class="clear">
                </div>
                <div class="divp">
                    <span class="title2">
                        <asp:Literal ID="Literal12" runat="server" Text='<%$ Code:  LocalizationProvider.Instance["ContactoApellido"]%>' />:</span>
                    <asp:TextBox ID="txtApellido" runat="server" CssClass="inputs inputlong" ClientIDMode="Static"
                        title='<%$ Code:  LocalizationProvider.Instance["ContactoApellidoTitle"]%>'></asp:TextBox>
                </div>
                <div class="clear">
                </div>
                <div class="divp">
                    <span class="title2">
                        <asp:Literal ID="Literal13" runat="server" Text='<%$ Code:  LocalizationProvider.Instance["ContactoNacionalidad"]%>' />:</span>
                    <asp:DropDownList ID="cboPais" runat="server" CssClass="cbo" ClientIDMode="Static">
                    </asp:DropDownList>
                </div>
                <div class="clear">
                </div>
                <div class="divp">
                    <span class="title2">
                        <asp:Literal ID="Literal14" runat="server" Text='<%$ Code:  LocalizationProvider.Instance["ContactoCumpleanos"]%>' />:</span>
                    <asp:DropDownList ID="cboCumpleDia" runat="server" CssClass="cboDia">
                    </asp:DropDownList>
                    <asp:DropDownList ID="cboCumpleMes" runat="server" CssClass="cboMes">
                    </asp:DropDownList>
                    <asp:DropDownList ID="cboCumpleAnio" runat="server" CssClass="cboAnio" ClientIDMode="Static">
                    </asp:DropDownList>
                </div>
                <div class="clear">
                </div>
                <div class="divp">
                    <span class="title2">
                        <asp:Literal ID="Literal32" runat="server" Text='<%$ Code:  LocalizationProvider.Instance["Contacto.Sexo"]%>' />:</span>
                    <asp:DropDownList ID="cboSexo" runat="server" CssClass="cbo" ClientIDMode="Static">
                    </asp:DropDownList>
                </div>
                <div class="clear">
                </div>
                <div class="divpSinHeight">
                    <span class="title2">
                        <asp:Literal ID="Literal27" runat="server" Text='<%$ Code:  LocalizationProvider.Instance["Contacto.DeseaRecibirEmails"]%>' />:</span>
                    <asp:CheckBox ID="chkDeseaRecibirEmails" runat="server" Checked="true" />
                </div>
                <div class="clear">
                </div>
            </div>
            <div class="divDatosRight">
                <div class="divpSinHeight" id="divFechaUltimaCompraForDblClick">
                    <span class="title3">
                        <asp:Literal ID="Literal15" runat="server" Text='<%$ Code:  LocalizationProvider.Instance["ContactoUltimaCompra"]%>' />:</span>
                    <asp:TextBox ID="txtFechaUltimaCompra" runat="server" CssClass="inputs readonly"
                        ClientIDMode="Static" ReadOnly="true"></asp:TextBox>
                </div>
                <div class="clear">
                </div>
                <div class="lstp divpSinHeight">
                    <span style="line-height: 1.6em" class="title4">
                        <asp:Literal ID="Literal16" runat="server" Text='<%$ Code:  LocalizationProvider.Instance["ContactoCategoria"]%>' />:</span>
                    <asp:ListBox ID="lstCategoria" runat="server" ClientIDMode="Static" CssClass="inputs lst"
                        SelectionMode="Multiple"></asp:ListBox>
                </div>
                <div class="clear">
                </div>
                <fieldset class="opcionales">
                    <legend>
                        <asp:Literal ID="Literal22" runat="server" Text='<%$ Code:  LocalizationProvider.Instance["FieldsetCamposOpcionales"]%>' /></legend>
                    <div class="divp">
                        <span class="title2">
                            <asp:Literal ID="Literal17" runat="server" Text='<%$ Code:  LocalizationProvider.Instance["ContactoDomicilio"]%>' />:</span>
                        <asp:TextBox ID="txtDomicilio" runat="server" CssClass="inputs" ClientIDMode="Static"
                            title='<%$ Code:  LocalizationProvider.Instance["ContactoDomicilioTitle"]%>'></asp:TextBox>
                    </div>
                    <div class="clear">
                    </div>
                    <div class="divp">
                        <span class="title2">
                            <asp:Literal ID="Literal18" runat="server" Text='<%$ Code:  LocalizationProvider.Instance["ContactoCodigoPostal"]%>' />:</span>
                        <asp:TextBox ID="txtCodigoPostal" runat="server" CssClass="inputs" ClientIDMode="Static"
                            title='<%$ Code:  LocalizationProvider.Instance["ContactoCodigoPostalTitle"]%>'></asp:TextBox>
                    </div>
                    <div class="clear">
                    </div>
                    <div class="divp">
                        <span class="title2">
                            <asp:Literal ID="Literal19" runat="server" Text='<%$ Code:  LocalizationProvider.Instance["ContactoProvincia"]%>' />:</span>
                        <asp:DropDownList ID="cboProvincia" runat="server" CssClass="cbo" ClientIDMode="Static">
                        </asp:DropDownList>
                    </div>
                    <div class="clear">
                    </div>
                    <div class="divp">
                        <span class="title2">
                            <asp:Literal ID="Literal20" runat="server" Text='<%$ Code:  LocalizationProvider.Instance["ContactoTelefono"]%>' />:</span>
                        <asp:TextBox ID="txtTelefono" runat="server" CssClass="inputs" ClientIDMode="Static"
                            title='<%$ Code:  LocalizationProvider.Instance["ContactoTelefonoTitle"]%>'></asp:TextBox>
                    </div>
                    <div class="clear">
                    </div>
                    <div class="divp">
                        <span class="title2">
                            <asp:Literal ID="Literal21" runat="server" Text='<%$ Code:  LocalizationProvider.Instance["ContactoCredencial"]%>' />:</span>
                        <asp:TextBox ID="txtCredencial" runat="server" CssClass="inputs" ClientIDMode="Static"
                            title='<%$ Code:  LocalizationProvider.Instance["ContactoCredencialTitle"]%>'></asp:TextBox>
                    </div>
                    <div class="clear">
                    </div>
                     <p>
                        <span class="title2 titlesmall">
                            <asp:Literal ID="Literal31" runat="server" Text='<%$ Code:  LocalizationProvider.Instance["Contacto.CantidadHijos"]%>' />:</span>
                        <asp:DropDownList ID="cboCantidadHijos" runat="server" CssClass="cbo" ClientIDMode="Static"
                           >
                        </asp:DropDownList>
                    </p>
                    <div class="clear">
                    </div>
                    <p class="divp">
                        <span class="title2 titlesmall">
                            <asp:Literal ID="Literal33" runat="server" Text='<%$ Code:  LocalizationProvider.Instance["Contacto.EdadHijoMenor"]%>' />:</span>
                        <asp:DropDownList ID="cboEdadHijoMenor" runat="server" CssClass="cbo" ClientIDMode="Static"
                            >
                        </asp:DropDownList>
                          <div class="clear">
                    </div>
                    </p>
                    <div class="clear">
                    </div>
                </fieldset>
                <div class="clear">
                </div>
            </div>
            <div class="clear">
            </div>
        </asp:Panel>
        <%--Panel de comandos--%>
        <br />
        <asp:Panel ID="pnlFacturas" runat="server" ClientIDMode="Static" CssClass="editionContainerFilter">
            <div id="div_factu_1" class="selector">
                <p>
                    <span class="titlesmall">
                        <asp:Literal ID="Literal23" runat="server" Text='<%$ Code:  LocalizationProvider.Instance["VentaFacturaText"]%>' />:</span>
                    <input type="text" id="txtFactura_1" name="txtFactura_1" clientidmode="Static" class="inputs"
                        title='<%$ Code:  LocalizationProvider.Instance["FacturaTextTitle"]%>' maxlength="6"
                        runat="server" />
                    <br />
                    <span class="titlesmall" style="color: white">
                        <asp:Literal ID="Literal24" runat="server" Text='<%$ Code:  LocalizationProvider.Instance["VentaFacturaText"]%>' />:</span>
                    <input type="text" id="txtFacturaValid_1" class="inputs" title='<%= LocalizationProvider.Instance["VentaRescribirFacturaTitle"]%>'
                        maxlength="6" />
                </p>
                <p>
                    <span class="titlesmall secondColumnSmall">
                        <asp:Literal ID="Literal28" runat="server" Text='<%$ Code:  LocalizationProvider.Instance["Venta.FechaDeVenta"]%>' />:</span>
                    <input type="text" clientidmode="Static" runat="server" id="txtFechaVenta_1" class="inputs"
                        title='<%= LocalizationProvider.Instance["Venta.FechaDeVenta"]%>' />
                </p>
                <p>
                    <span class="titlesmall secondColumnSmall">
                        <asp:Literal ID="Literal25" runat="server" Text='<%$ Code:  LocalizationProvider.Instance["VentaCampanaText"]%>' />:</span>
                    <asp:DropDownList ID="cboCampania_1" runat="server" CssClass="cbo" ClientIDMode="Static">
                    </asp:DropDownList>
                     <br />
                    <span class="titlesmall secondColumnSmall" >
                        <asp:Literal ID="Literal30" runat="server" Text='<%$ Code:  LocalizationProvider.Instance["Pdv.CodigoMarketingCupon"]%>' />:</span>
                        <input type="text" id="txtCodigoMarketing_1" runat="server" class="inputs txtcodigoMarketing" ClientIDMode="Static"  />
                </p>
                <div class="clear">
                </div>
            </div>
            <a href="javascript:void();" onclick="javascript:window.CustomerSearchObj.AgregarFactura();"
                class="addFactura">
                <asp:Literal ID="Literal26" runat="server" Text='<%$ Code:  LocalizationProvider.Instance["VentaAgregarMas"]%>' /></a>
            <div class="clear">
            </div>
        </asp:Panel>
        <br />
        <asp:Button ID="btnGuardar" runat="server" Text='<%$ Code:  LocalizationProvider.Instance["ButtonGuardar"]%>'
            CssClass="btnGuardar" OnClick="btnGuardar_Click" OnClientClick="return window.CustomerSearchObj.ValidarGuardar(); " />
        <asp:Button ID="btnCancelar" runat="server" Text='<%$ Code:  LocalizationProvider.Instance["ButtonCancelar"]%>'
            CssClass="btnGuardar" CausesValidation="false" OnClick="btnCancelar_Click" OnClientClick="if(document.DirtyCheck.areControlsDirty()) { return confirm(JsLocalization_CustomerSearch_ConfirmCancel);} else { return true;}" />
    </asp:Panel>
    <asp:Panel ID="pnlViewSales" runat="server" ClientIDMode="Static" CssClass="displayNone"
        title='<%$ Code: LocalizationProvider.Instance["Pdv.CustomerViewSales.Title"]%>'
        Width="100%" Height="100%" ScrollBars="None">
        <iframe id="iframeVentas" src="" width="100%" height="100%" frameborder="0"></iframe>
    </asp:Panel>
    <asp:Panel ID="pnlViewBitacora" runat="server" ClientIDMode="Static" CssClass="displayNone"
        title='<%$ Code: LocalizationProvider.Instance["Pdv.CustomerViewBitacora.Title"]%>'
        Width="100%" Height="100%" ScrollBars="None">
        <iframe id="iframeBitacora" src="" width="100%" height="100%" frameborder="0"></iframe>
    </asp:Panel>   
    <asp:LinkButton ID="lnkActivarContacto" OnClick="lnkActivarContacto_Click" runat="server" CssClass="displayNone" ClientIDMode="Static"></asp:LinkButton>
    <script type="text/javascript">
        $(document).ready(function () {

            $('input[title]').inputHints();

            document.DirtyCheck = new DirtyCheck();
            document.DirtyCheck.loadControlState();
            window.CustomerSearchObj = new CustomerSearch();

            $("#lstCategoria").dropdownchecklist({ icon: {}, width: 150 });
            $('#txtFechaVenta_1').datepick({ dateFormat: 'dd/mm/yyyy' });

            // Iframe de Ventas
            $('#pnlViewSales').dialog({
                height: '600',
                autoOpen: false,
                width: '900',
                modal: true
            });

            // Iframe de Ventas
            $('#pnlViewBitacora').dialog({
                height: '600',
                autoOpen: false,
                width: '600',
                modal: true
            });

            $('#btnBitacora').click(function () {
                var clienteId = $('#hidClienteId').val();
                $('#iframeBitacora').attr('src', '/App/CustomerBitacora.aspx' + '?Id=' + clienteId);
                $('#pnlViewBitacora').dialog('open');
                return false;
            });

            $('#btnVentas').click(function () {
                var clienteId = $('#hidClienteId').val();
                $('#iframeVentas').attr('src', '/App/CustomerSales.aspx' + '?Id=' + clienteId);
                $('#pnlViewSales').dialog('open');
                return false;
            });

            $('#divFechaUltimaCompraForDblClick').dblclick(function () {
                var clienteId = $('#hidClienteId').val();
                $('#iframeVentas').attr('src', '/App/CustomerSales.aspx' + '?Id=' + clienteId);
                $('#pnlViewSales').dialog('open');
                return false;
            });

            window.CustomerSearchObj.initializeEnterKeyEvent($('.pbuscar'), function () {
                __doPostBack($('#btnBuscar').attr('aspnetid'), '');
            });

            if ($('#lnkActivarContacto').length > 0) {
                if (confirm(JsLocalization_ClientSearchJs_ConfirmarActivarContacto)) {
                    __doPostBack($('#lnkActivarContacto').attr('aspnetid'), '');                                        
                }
            }
        });        

    </script>
</asp:Content>
